package com.zkjl.protect_business.repository;


import com.zkjl.protect_business.entity.Organization;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

import java.util.List;

public interface OrganizationRepository extends ElasticsearchRepository<Organization,String> {

    List<Organization> findAllByPidOrderByCreateTimeAsc(String pid);

    List<Organization> findAllByOrgNameAndIdNot(String orgName, String id);
    List<Organization> findAllByOrgName(String orgName);

    List<Organization> findAllByOrOrgNum(String orgNum);

    List<Organization> findAllByOrOrgNumAndIdNot(String orgNum, String id);

    List<Organization> findAllByPid(String pid);

    List<Organization> findAllByRegion(String region);


    Organization findByOrgNameOrOrgNum(String orgName, String orgNum);


}
